package com.jzx.provider.cv.repository;

import com.jzx.provider.cv.model.CurrentInfo;
import com.jzx.provider.cv.model.ProjectInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * Created by chuzhaowi on 2019/12/21
 */
public interface CurrentInfoRepository extends JpaRepository<CurrentInfo, Integer> {
    /**
     * 根据简历id查看简历信息
     * @param cvId 简历id
     * @return 简历当前信息
     */
    CurrentInfo findByCvId(Long cvId);

    @Modifying
    @Query(nativeQuery = true, value = "update t_current_info set now_location=:#{#currentInfo.nowLocation}," +
            "switch_status=:#{#currentInfo.switchStatus},salary=:#{#currentInfo.salary}," +
            "update_time=:#{#currentInfo.updateTime} where id=:#{#currentInfo.id}")
    void updateCvCurrentInfo(CurrentInfo currentInfo);
}
